<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>公司公告详细</title>
<script type='text/javascript' src='js/jquery-1.4.2.min.js'></script>
<script type='text/javascript' src='js/jquery.validate.min.js'></script>
<script type='text/javascript' src='js/common.js'></script>
<link href="manage/manage.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function backCom()
{
	 document.location.href="comment!listUserComent.action";
}

function checkValid(){
    var title=$.trim($("#ctitle").val());    //标题
	var sendName=$.trim($("#uName").val());    //发送者
	var comName = $.trim($("#compangName").val());  //所属公司
	var upic=$.trim($("#file").val());    //发送者
	var content = $.trim($("#neirong").val());  //内容
	if(title==""){  
		$("#titleSpan").html("请输入评价标题");
		$("#ctitle").focus();
		return false;
	}
	if(sendName==""){  
		$("#titleSpan").html("");
		$("#uNameSpan").html("请输入评价者姓名");
		$("#uName").focus();
		return false;
	}
	
	if(comName==""){  
		$("#uNameSpan").html("");
		$("#compangyNameSpan").html("请输入公司名字姓名");
		$("#compangyName").focus();
		return false;
	}
	
	if(upic!=""){  
		var num=upic.lastIndexOf(".");
		var fileext=upic.substring(num+1,upic.length);
		if (fileext!='jpg'&&fileext!='gif'&&fileext!='jpeg'&&fileext!='png')
	        {
	           $("#fileSpan").html("图片格式不正确!只限gif.jpg,jpeg,png");
	           return false;
	        }
	}
	
	
	
   if(content==""){  
		$("#compangyNameSpan").html("");
		$("#conentSpan").html("请输入公告内容");
		$("#neirong").focus();
		return false;
	}
	
$("#upUserComForm").submit();
}

</script>

</head>
<body style="margin:0px; text-align:center;font-size:12px;" bgcolor="#F1F1F1" >
<div id="top">
 	<!-- 头部-->
 	<%@include file="mainTop.jsp"%>
</div>
<div id="top2"></div>

<!-- 中间-->
<div id="main1">
<!-- 左边-->
 <%@include file="mainLeft.jsp"%>
 <div class="mainr2">
 </div>
<!-- 中间右边内容 -->
<s:form action="comment!updateUserComent.action" name="upUserComForm" id="upUserComForm" enctype="multipart/form-data">
<table width="760"  height="493" border="0" bgcolor="#FFFFFF" style="font-size:12px;">
  <tr>
    <td width="190" height="21" align="left" valign="top""><img src="images/dian.jpg" width="18" height="15"><span class="STYLE3">用户评价</span></td>
    <td width="248" > <input name="detailId" type="hidden" id="detailId" size="15" value="${detailCom.id}"></td>
    <td width="206" align="right" valign="top" ><img src="images/sp_bg.jpg" width="18" height="16"><a href="comment!listUserComent.action">返回用户评价列表</a></td>
  </tr>
   <tr>
    <td height="30" colspan="2" align="left">评价标题：
      <input name="ctitle" id="ctitle" value="${detailCom.title}" style="background: #CCCCCC"/><span style="color:red">*</span><span style="color:red"  id="titleSpan"></span></td>
    <td rowspan="3" align="left" valign="bottom">
	已使用图片：<img src="<%=basePath%>/upload/usercoment_pic/${detailCom.ico}" width="66" height="78">
	&nbsp;</td>
   </tr>
	  <tr>
    <td height="30" colspan="2" align="left"> &nbsp;&nbsp;&nbsp; 评价者：
      <input name="uName" id="uName" value="${detailCom.userName}" style="background: #CCCCCC"/><span style="color:red">*</span><span style="color:red"  id="uNameSpan"></span></td>
    </tr>
	  <tr>
    <td height="30" colspan="2" align="left">所属公司：
      <input name="compangName" id="compangName" value="${detailCom.company}" style="background: #CCCCCC"/><span style="color:red">*</span><span style="color:red"  id="compangyNameSpan"></span></td>
    </tr>
	  <tr>
    <td height="31" colspan="3" align="left" valign="bottom">用户头像：
	  <input type="file" name=file id="file" size="24" />
	 <span style="color:red">*</span>  &nbsp;&nbsp;<span style="color:red"  id="fileSpan">不选择则继续使用已用图片</span></td>
    </tr>
  <tr>
    <td height="278" colspan="3" align="left">评价内容：
    <textarea style="background: #CCCCCC;" name="neirong" cols="80" rows="20" id="neirong">${detailCom.content}</textarea><span style="color:red">*</span></td>
    </tr>
     <tr>
      <td height="15" colspan="3" align="left"><span style="color:red" id="conentSpan"></span></td>
   </tr>
   <tr>
    <td height="38" colspan="3" align="center"><input type="button"  value="保存编辑" onClick="checkValid();">&nbsp;&nbsp;
      <input type="button"  value=" 取 消 " onClick="backCom();"></td>
    </tr>
</table>
</s:form>
</div>
</body>
</html>
